package org.cnc.explain.listbean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * org.cnc.spring.explain.listbean - UsageBean
 *
 * @author tony-is-coding
 * @date 2022/6/30 10:41
 */
@Service
public class ListBeanUsageBean {
	// 多bean注入时, 会按照bean 的order 从小到大排序，默认order为最大值 Integer.MAX_VALUE
	@Autowired
	List<ListBean> listBeans;

	public void printList() {
		for (ListBean lb : listBeans) {
			System.out.println("bean:" + lb + "; order is:" + lb.getOrder());
		}
	}
}
